<template>
  <div>
    <!-- <TopFilter :list="topFilterList" :cols="3" @filterChange="changeHandle" :collapse="false" :isSubmitBtn="false"></TopFilter> -->
    <importFile title="导入" :actionUrl="url" @close="closeHandler" />
    <div style="height:47px;"></div>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }"
    >
      <el-button @click="closeDrawer(1)">关闭</el-button>
    </div>
  </div>
</template>
<script>
import moment from 'moment';
export default {
  data() {
    return {
      topFilterList: this.createdFrom(),
      columns: this.createdTable(),
      urls: '/ttFiRebateRedApply/upload',
      url: `/ttFiRebateRedApply/upload`,
      fetchParams: {},
      fetchApi: () => {}
    };
  },
  methods: {
    createdFrom() {
      return [
        {
          type: 'DATE',
          label: '月份',
          fieldName: 'month',
          placeholder: '请选择',
          dateType: 'month',
          clearable: false,
          initialValue: moment().format('YYYY-MM'),
          change: p => {
            console.log(p, '222');
            this.url = this.urls + '?templateYearAndMonth=' + p;
          }
        }
      ];
    },
    createdTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          fixed: 'left',
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: 'excel表格行号',
          dataIndex: 'gsmc',
          sorter: true,
          filter: true,
          filterType: 'input'
        },
        {
          title: '信息(错误/成功)',
          dataIndex: 'gsmc',
          sorter: true,
          filter: true,
          filterType: 'input'
        }
      ];
    },
    changeHandle(val) {
      this.fetchParams = Object.assign({}, this.fetchParams, val);
    },
    closeDrawer(type) {
      this.$emit('close');
    },
    closeHandler(val) {
      console.log(val, '111');
    },
    selectChangeHandle(val) {}
  }
};
</script>
